1. Field of the Invention
The present invention relates to an image processing method, an image processing apparatus and a medium recording an image processing program, and particularly to an image processing method, an image processing apparatus and a medium recording an image processing program for performing encoding processing on image data.
2. Description of the Related Art
There has been a compression method called BTC (Block Truncation Coding) as a technique of encoding and thereby compressing image data. According to the BTC compression, an original image data is divided into a plurality of regions, and encoding is performed by expressing all picture elements in each region by a predetermined number or less of representative colors. According to the BTC compression, each picture element is replaced with a color value so that original image data is compressed to reduce its information quantity. However, the compressed data includes information corresponding to the number of picture elements of the original image. Therefore, the compression efficiency is not necessarily high.
Accordingly, there have been proposed various techniques for compressing image data more efficiently in the method of encoding the picture elements by replacing them with information of fewer colors. For example, Japanese Laid-Open Patent Publication No. 09-322162 (document 1) has disclosed a technique of performing compression in a special mode, and particularly compression that is executed in view of continuity of picture elements when all the picture elements in a block have the same color value. Further, Japanese Laid-Open Patent Publication No. 2007-043577 has disclosed a technique in which compressed image data is divided into data items of predetermined sizes and secondary compression is performed on them.
However, even when the above method employs the technique disclosed in the document 1, such a problem occurs that the continuity does not effectively act on compressibility when a large change in color such as a gradation is present in the original image. Particularly, when the original image has a gradation in a direction (e.g., lateral direction) matching a compression direction, the above problem becomes remarkable.